package com.shouhe.mysap.common;

import java.io.Serializable;

/**
 * @author 守鹤
 * @date 2020/5/17 12:22
 */
public class MySapResult implements Serializable {
    private boolean success;

    private String msg;

    private Object data;

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public MySapResult() {
    }


    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }



    public MySapResult(boolean success, String msg) {
        this.success = success;
        this.msg = msg;
    }
    public MySapResult(boolean success, String msg, Object data) {
        this.success = success;
        this.msg = msg;
        this.data=data;
    }

    public static MySapResult success(){
        return new MySapResult(true,"Success");
    }
    public static MySapResult success(Object data){
        return new MySapResult(true,"Success",data);
    }

    public static MySapResult fail(String msg){
        return new MySapResult(false,msg);
    }

    public static MySapResult fail(){
        return new MySapResult(false,"出错啦!");
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
